package com.epoint.ServletAPI;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

// @WebServlet(urlPatterns = {"/myservlet"}) 方式一，结合servlet3.0的方式，方法二 通过Springboot注入的方式
public class MyServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行了MyServlet~~~~");
        resp.getWriter().write("Epoint_JKH");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行了MyServlet~~~~");
        super.doPost(req, resp);
    }
}
